

#ifndef ENVVARS_CFGDLG_H
#define ENVVARS_CFGDLG_H

#include <wx/event.h>
#include <wx/string.h>
#include <wx/window.h>

#include "configurationpanel.h"

class EnvVars;
class wxChoice;


class EnvVarsConfigDlg : public cbConfigurationPanel
{
public:
  /// Ctor
           EnvVarsConfigDlg(wxWindow* parent);
  /// Dtor
  virtual ~EnvVarsConfigDlg()
  { };

  /// returns the title of the plugin configuration panel
  virtual wxString GetTitle() const
  { return _("Environment variables"); }

  /// returns the title of the plugin's bitmap to use for configuration dialog
  virtual wxString GetBitmapBaseName() const
  { return _T("envvars"); }

protected:
    void OnUpdateUI         (wxUpdateUIEvent& event);

private:
  /// Fires if the "apply" button is pressed inside C::B settings
  virtual void OnApply()
  { SaveSettings(); }

  /// Fires if the "cancel" button is pressed inside C::B settings
  virtual void OnCancel()
  { ; }

    void LoadSettings();
    void SaveSettings();
    void SaveSettingsActiveSet(wxString active_set);

    void OnSetClick         (wxCommandEvent&  event);
    void OnCreateSetClick   (wxCommandEvent&  event);
    void OnCloneSetClick    (wxCommandEvent&  event);
    void OnRemoveSetClick   (wxCommandEvent&  event);

    void OnToggleEnvVarClick(wxCommandEvent&  event);
    void OnAddEnvVarClick   (wxCommandEvent&  event);
    void OnEditEnvVarClick  (wxCommandEvent&  event);
    void OnDeleteEnvVarClick(wxCommandEvent&  event);
    void OnClearEnvVarsClick(wxCommandEvent&  event);
    void OnSetEnvVarsClick  (wxCommandEvent&  event);

  /// Verifies that an envvar set is unique
  bool VerifySetUnique(const wxChoice* choSet, wxString set);

  DECLARE_EVENT_TABLE()
};

#endif // ENVVARS_CFGDLG_H
